Converts a string to a numeric expression.
文字列を数式に変換します。
Val (Text As String)
Val (Text As String)
Double
倍精度
Text: String that represents a number.
Text: 数値を示す文字列。
Using the Val function, you can convert a string that represents numbers into numeric expressions. This is the inverse of the Str function. If only part of the string contains numbers, only the first appropriate characters of the string are converted. If the string does not contain any numbers, the Val function returns the value 0.
Val 関数を使うことで、数値を示す文字列を数値に変換できます。これは、Str 関数の逆の操作を行います。文字列の一部だけが数字である場合、最初の該当部分だけが変換されます。文字列に数字がまったく含まれない場合、Val 関数は0を返します。
Sub ExampleVal
Sub ExampleVal
msgbox Val("123.123")
msgbox Val("123.123")
msgbox Val("A123.123")
msgbox Val("A123.123")
end Sub
end Sub